#!/usr/bin/env ruby

$LOAD_PATH << File.expand_path("../../lib")

require 'flgrcore'
require 'flgrmorpho'
require 'flgrrtview'
require 'flgrrtcapture'


imin = Flgrcore::FLGR_Data2D.new(480,640,'fgUINT8','flow')
imout = Flgrcore::FLGR_Data2D.new(480,640,'fgUINT8','flow')


cam0 = Flgrrtcapture::flgr2d_rtcapture_create("/dev/video0")
scr0 = Flgrrtview::flgr2d_rtview_create(imin)

for i in (0..2000)
  Flgrrtcapture::flgr2d_rtcapture_get_image(imin, cam0)
  Flgrmorpho::flgr2d_open_tophat_octagon_fgUINT8(imout,imin,15)
  Flgrrtview::flgr2d_rtview_refresh(scr0, imout)
end
